﻿
/**
 * 使用方法:
 *   var map = new Map();
 *   map.put("基本工资",100);
 *   alert(map.get("基本工资"));
 */
 function Map(){
	this.map = {};
	//this.map = {"基本工资":100,"浮动工资":50,"应发工资":150};//map的格式	
}

Map.prototype={
	put:function(key,value){
		//this.map.key = value;
		this.map[key] = value;
	},
	get:function(key){
		//return this.map.key;
		return this.map[key];
	},
	iterator:function(){//遍历map
		for(var key in this.map){
			alert("key = " + key + " , value = " + this.map[key]);
		}
	},
	setMap:function(map){
		this.map = map;
	},
	getMap:function(){
		return this.map;
	}
}